/*
 * Copyright (C) 2009 Luc Boudreau
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
 *
 * @created Apr 23, 2009 
 * @author Luc Boudreau
 */
package com.encon.projecttracker.rpc;

import java.util.List;

import org.springframework.security.annotation.Secured;


import com.encon.projecttracker.rpc.beans.TestDTO;
import com.encon.projecttracker.rpc.exceptions.RpcException;
import com.google.gwt.user.client.rpc.RemoteService;

/**
 * The session RPC interface is responsible for screen operations. It exposes
 * calls to establish connections, start sessions and so forth.
 * 
 */
public interface Session extends RemoteService {

	
	/**
	 * Creates a new session. Call this method for every browser window that
	 * gets opened. It will return to you a unique identification string
	 * which you will need to provide for all future calls.
	 * @return A unique session identification string.
	 * @throws RpcException If something goes sour.
	 */
	@Secured ({"ROLE_USER"})
	public String createSession() throws RpcException;
	
	/**
	 * Destroys the session on the server. Call this method when the browser
	 * window is closed.
	 * @param sessionId The session id to close and destroy.
	 * @throws RpcException If something goes sour.
	 */
	@Secured ({"ROLE_USER"})
	public void closeSession(String sessionId) throws RpcException;

	public List<String> getRole(String sessionId) throws RpcException;
}
